<?php
$this->breadcrumbs = array(
	'Leaves'=>array('index'),
	$model->name,
);

$this->menu = array(
	array('label'=>'List Leave', 'url'=>array('index')),
	array('label'=>'Create Leave', 'url'=>array('create')),
	array('label'=>'Update Leave', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete Leave', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete', 'id'=>$model->id), 'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage Leave', 'url'=>array('admin')),
);
?>

<h1>Reject Leave #<?php echo $model->id; ?></h1>

<div class="flash-notice round center">
	<div>Please confirm if you wish to reject.</div>

	<div>
		<?php
		$htmlOptions = array(
			'submit'=>array('reject', 'id'=>$model->id),
			'params'=>array('confirm'=>1)
		);
		echo CHtml::link('Yes', '#', $htmlOptions);
		?> /
		<?php
		echo CHtml::link('No', array('view', 'id'=>$model->id));
		?>
	</div>
</div>

<?php
$htmlOptions = array(
	'id'=>'history',
	'target'=>'_blank',
);
$url = array(
	'_history',
	'employeeId'=>$model->employeeId,
);
$history = CHtml::link('History', $url, $htmlOptions);
$name = CHtml::encode($model->employee->name) . " <sup>($history)</sup>";
$data = array(
	'data'=>$model,
	'attributes'=>array(
		array(
			'label'=>$model->getAttributeLabel('employeeId'),
			'type'=>'raw',
			'value'=>$name,
		),
		'name',
		array(
			'label'=>$model->getAttributeLabel('start'),
			'name'=>'unixStart',
			'type'=>'date',
		),
		array(
			'name'=>'debit',
			'type'=>'number',
		),
		array(
			'name'=>'balance',
			'type'=>'number',
		),
		'status',
		array(
			'name'=>'note',
			'type'=>'ntext',
		),
	),
);
$this->widget('zii.widgets.CDetailView', $data);

Yii::app()->clientScript->registerCoreScript('jquery');
Yii::app()->clientScript->registerCoreScript('jquery.ui');

$config = array(
	'scrolling'=>'auto',
	'titleShow'=>false,
	'transitionIn'=>'elastic',
	'transitionOut'=>'elastic',
	'easingIn'=>'easeOutBack',
	'easingOut'=>'easeInBack',
	'overlayColor'=>'#000',
	'showCloseButton'=>true,
	'autoDimensions'=>false,
	'width'=>800,
);
$this->widget('EFancyBox', array('target'=>'#history', 'config'=>$config));
?>
